<?php
include_once VURENO_PATH.'/iwc/engine/IWC3Standard.class.php';
class Framework extends IWC3Standard {
	public static function needsToImplement($package){
		
		$tmp=split('\.',$package);
		$class=$tmp[count($tmp)-1];
		
		
		if(interface_exists($class)) return null;
		
		$file=VURENO_PATH."/iwc/interfaces/".str_replace('.',DIRECTORY_SEPARATOR,$package).".interface.php";
		if(file_exists($file)){
			include($file);
		} else {
			die("File '".$file."' Not Exists!");
		}
		
	}
	public static function needs($package){
		$tmp=split('\.',$package);
		$class=$tmp[count($tmp)-1];
		
		if(class_exists($class)) return null;
		
		$file=VURENO_PATH."/iwc/".str_replace('.',DIRECTORY_SEPARATOR,$package).".class.php";
		if(file_exists($file)){
			include($file);
			
			if(!class_exists($class)) {
				Logger::write(Logger::DEVEL_ERROR," The class '".$class."' not exists on ".$package);
				die("Wrong class name: ".$class."!");
			}
		} else {
			die("File '".$file."' Not Exists!");
		}
	}
	public static function import($package){
		Framework::needs(str_replace('::','.',$package));
	}
	public static function makeWrapper($filename,$content){
		if(COMPLETE_RUNNING==false) {
			file_put_contents($filename,$content);
		} else if(!file_exists($filename)) {
			file_put_contents($filename,$content);
		}
		return SYSTEM_URL.'/wrappers/'.$filename;
	}
	public static function loadTemplate($file,$cachable=true){
		$html=file_get_contents($file);
	}
}

?>